#ifndef EXPERIMENTPROPERTYUI_H
#define EXPERIMENTPROPERTYUI_H

#include <QDateTime>
#include <QListView>
#include <QScrollBar>
#include <QString>
#include <QWidget>
#include <QVariant>

#include "ConfigFileservice.h"
#include "devicemanagementui.h"
#include "global.h"
#include "QPCRDB.h"
#include "UiStruct.h"
#include "custommessagebox.h"
#include "customlineedit.h"
#include "ExperimentService.h"


namespace Ui {
class ExperimentPropertyUi;
}

class ExperimentPropertyUi : public QWidget
{
    Q_OBJECT

public:
    explicit ExperimentPropertyUi(QWidget *parent = nullptr);
    ~ExperimentPropertyUi();

public:
    Ui::ExperimentPropertyUi *ui;

signals:
    void experimentTypeChanged(Experiment); // 改变实验类型
    void experimentInfoChanged(Experiment); // 改变实验数据
    void nextEvent(); // 下一步
    void saveEvent(); // 保存

public slots:
    void nextCallback(); // 下一步按钮

public:
    Experiment sendExperimentProperty(); // 发送实验属性数据
    Experiment returnPageInfos(); // 返回数据信息
    void changeCurrentActiveDevice(int index); // 设备改变联动
    void renderWLKProperty(Experiment experiment, ExperimentService *expService);
    void allComponentsInvalid(); // 所有组件失效
    void allComponentsValid(); // 所有组件生效
    QString sendExperimentName(); // 发送默认实验名称
    void writeBackExperimentId(QString id); // 反写实验id
    void setFocusToExpNameLineEdit(); // 鼠标聚焦实验名称文字框

protected:
    void showEvent(QShowEvent *event) override; // 窗口显示

public:
    Experiment experiment;

private:
    ConnectedDeviceStruct cds;
    QDateTime expTime;
    QList<QString> experimentType;
    CustomLineEdit *devComboboxEdit;
    QString expStringDate;
    SlaveComputerManagement *scmW;
    ConfigFileService *configFileService;
    ExperimentService *expService;
};

#endif // EXPERIMENTPROPERTYUI_H
